package com.imooc.o2o.dao;

import com.imooc.o2o.entity.Product;

import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ProductDao {

    List<Product> queryProductList(@Param("productCondition") Product product,
                                   @Param("rowIndex") int rowIndex, @Param("pageSize") int pageSize);

    int queryProductCount(@Param("productCondition") Product productCondition);

    int insertProduct(Product product);

    Product queryProductById(long productId);

    int updateProduct(Product product);

    int deleteProductImgProductId(long productId);

    /**
     * 删除商品类别之前，将商品类别ID置为空
     *
     * @param productCategoryId
     * @return
     */
    int updateProductCategoryToNull(long productCategoryId);

}